package com.fizz.redpacket.redis;

import org.springframework.beans.factory.annotation.Autowired;
/*    */ import org.springframework.data.redis.core.ListOperations;
/*    */ import org.springframework.data.redis.core.RedisTemplate;
/*    */ import org.springframework.stereotype.Component;

    @Component
    public class RedisRedPacketMapper {
        @Autowired
        RedisTemplate<String, Object> redisTemplate;

    public Long pushAllQueue(String key, String[] values) {
        ListOperations<String, Object> stringStringListOperations = this.redisTemplate.opsForList();
        return stringStringListOperations.leftPushAll(key, (Object[])values);
    }

    public Object popQueue(String key) {
/* 33 */     return this.redisTemplate.opsForList().rightPop(key);
/*    */   }
        public Object allQueue(String key, int start, int end) {
        return this.redisTemplate.opsForList().range(key, start, end);
    }

    public void decrementValue(String key) {
        this.redisTemplate.opsForValue().decrement(key);
    }

    public void setValue(String key, Object value) {
        this.redisTemplate.opsForValue().set(key, value);
    }

    public Object getValue(String key) {
        return this.redisTemplate.opsForValue().get(key);
    }

    public boolean setContains(String key, String userId) {
        return this.redisTemplate.opsForSet().isMember(key, userId).booleanValue();
    }

    public boolean containsKey(String key) {
        return this.redisTemplate.hasKey(key).booleanValue();
    }

    public void addSet(String key, String value) {
        this.redisTemplate.opsForSet().add(key, new Object[] { value });
    }

    public void addSetExpire(String key, String value, long time) {
        this.redisTemplate.opsForSet().add(key, new Object[] { value });
    }

    public boolean isSetContainsValue(String key, String value) {
        return this.redisTemplate.opsForSet().isMember(key, value).booleanValue();
    }
}


/* Location:              /home/fizz/Music/大学学习的知识总结/收获比较大的项目/redpacket/redpacket/src/main/docker8081/redpacket-0.0.1-SNAPSHOT.jar!/BOOT-INF/classes/com/fizz/redpacket/redis/RedisRedPacketMapper.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */